<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/global/global-head.jsp" %>
<script type="text/javascript">
    $(function() {
        //页面中的DOM已经装载完成时，执行的代码
        $(".menuMain > ul").hide();
        $(".menuMain > a").click(function(){
            //找到主菜单项对应的子菜单项
            var ulNode = $(this).next("ul");
            //
            $(".menuMain > ul").not($(this).next()).slideUp();
            ulNode.slideToggle();
            //changeIcon($(this));
        });

        $('#main-tab1').tabs({
            plain:true,
            narrow: true,
            border:false,
        });

        $(".menuMain").find("li").click(function(){
            var url=$(this).attr("url");
            var text=$(this).attr("txt");
            mainload(url,text);
        });

        function mainload(url,txt){
            //var h = $(document).height()-20;

            var tabs = $('#main-tab1');
            var opts = {
                title : txt,
                closable : true,
                content : '<iframe class="iframe_" id="" name="" src="${ctx}'+ getUrl(url)+'" allowTransparency="true" style="border:0;width:100%;height:99%;" frameBorder="0" ></iframe>',
                border : false,
                fit : true
            };
            if (tabs.tabs('exists', opts.title)) {
                tabs.tabs('select', opts.title);
            } else {
                parent.$.messager.progress({
                    text : '数据加载中....'
                });
                tabs.tabs('add', opts);
                $(".iframe_").hide();
                $(".iframe_").on("load",function(){
                    $(".iframe_").show();
                    parent.$.messager.progress('close');
                });
            }
        }
    });
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'west',split:false,border:true" title='<i class="fa fa-th-large" style="color:#4fb2ff;"></i>&nbsp;&nbsp;<font color="#000000">功能</font>' style="width:240px;">
        <div class="easyui-accordion" data-options="fit:true,border:false">
            <ul class="junmenu">
                <c:forEach var="li" items="${newMenusList}">
                    <li class="menuMain" >
                        <a style="color:#84888D;" class="hvr-bounce-to-right-sidebar-parent" href="#">
                            <span class="icon-sidebar ${li.iconClsExt} caidanbaba" style="font-size:24px;"></span>${li.text}<span class="icon-jilian fa fa-angle-left"></span>
                        </a>
                        <ul>
                            <c:forEach items="${li.children}" var="lii">
                                <li url="${ctx}${lii.href}" txt="${lii.text}">
                                    <a href="javascript:void(0)" ><span>${lii.text}</span></a>
                                </li>

                            </c:forEach>
                        </ul>
                    </li>
                </c:forEach>

            </ul>
        </div>
    </div>
    <div data-options="region:'center',border:false">
        <div class="easyui-tabs main-tab1" data-options="fit:true,border:false,plain:true"  id="main-tab1">
            <div id="homepage">
                <div class="welcome">欢迎使用当前管理功能</div>
            </div>
        </div>
    </div>
</div>